import requests
import json

keyurl="https://oapi.dingtalk.com/robot/send?access_token=59e6b3ec555e79f92b059e36be76fdf59af3a3dd80f284399c042efc74e8c963"

headers = {
    'Content-Type': 'application/json'
}
def send(msg):
    data =  {"msgtype": "text", "text": {"content": msg}}
    c = requests.post(url=keyurl,headers=headers,json=data)
    res = json.loads(c.content.decode('utf-8'))
    if res['errcode']==0:
        return True
    else:
        return False
    